<%@ page pageEncoding="utf-8"%>
<%@page import="org.myhibernate.util.Json"%>
<%@page import="org.myhibernate.Template"%>
<%@page import="org.myhibernate.ProxyTemplate"%>
<%@page import="org.json.JSONObject"%>
<%@page import="org.personal.entity.Page"%>
<%@page import="org.personal.entity.Layout"%>
<%@page import="org.personal.entity.User"%>
<%@page import="org.personal.Constants"%>
<%@page import="org.personal.entity.UserPage"%>
<%@page import="org.personal.util.UserUtil"%>
<%@page import="org.personal.entity.Portlet"%>
<%
String layoutId=request.getParameter("id");
Json json=new Json();
	Template template=new ProxyTemplate(Layout.class).getInstance();
	try
	{
		Layout layout=(Layout)template.get(Integer.parseInt(layoutId));
		if(layout != null)
		{
			json.add("result","ok");
			Json data=new Json();
			data.add("id",layout.getId());
			data.add("title",layout.getTitle());
			data.add("pagePath",layout.getPagePath());
			data.add("defaultLayout",layout.getDefaultLayout());
			
			json.add("data",data);
		}else
		{
			json.add("result","no");
			json.add("message","未找到");
		}
		
	}catch(Exception exception)
	{
		json.add("result","no");
		json.add("message",exception.toString().trim());
	}
	finally
	{
		template.close();
	}
out.println(json);
%>
